## API Report File for "@backstage/plugin-tech-insights-node"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts
import { CheckResult } from '@backstage/plugin-tech-insights-common';
import { Config } from '@backstage/config';
import { DateTime } from 'luxon';
import { Duration } from 'luxon';
import { DurationLike } from 'luxon';
import { ExtensionPoint } from '@backstage/backend-plugin-api';
import { FactSchema } from '@backstage/plugin-tech-insights-common';
import { HumanDuration } from '@backstage/types';
import { JsonValue } from '@backstage/types';
import { Logger } from 'winston';
import { PluginEndpointDiscovery } from '@backstage/backend-common';
import { TokenManager } from '@backstage/backend-common';

// @public
export type CheckValidationResponse = {
  valid: boolean;
  message?: string;
  errors?: unknown[];
};

// @public
export interface FactChecker<
  CheckType extends TechInsightCheck,
  CheckResultType extends CheckResult,
> {
  getChecks(): Promise<CheckType[]>;
  runChecks(entity: string, checks?: string[]): Promise<CheckResultType[]>;
  validate(check: CheckType): Promise<CheckValidationResponse>;
}

// @public
export interface FactCheckerFactory<
  CheckType extends TechInsightCheck,
  CheckResultType extends CheckResult,
> {
  // (undocumented)
  construct(
    repository: TechInsightsStore,
  ): FactChecker<CheckType, CheckResultType>;
}

// @public
export type FactLifecycle = TTL | MaxItems;

// @public
export interface FactRetriever {
  description?: string;
  entityFilter?:
    | Record<string, string | symbol | (string | symbol)[]>[]
    | Record<string, string | symbol | (string | symbol)[]>;
  handler: (ctx: FactRetrieverContext) => Promise<TechInsightFact[]>;
  id: string;
  schema: FactSchema;
  title?: string;
  version: string;
}

// @public
export type FactRetrieverContext = {
  config: Config;
  discovery: PluginEndpointDiscovery;
  logger: Logger;
  tokenManager: TokenManager;
  entityFilter?:
    | Record<string, string | symbol | (string | symbol)[]>[]
    | Record<string, string | symbol | (string | symbol)[]>;
};

// @public
export type FactRetrieverRegistration = {
  factRetriever: FactRetriever;
  cadence?: string;
  timeout?: Duration | HumanDuration;
  lifecycle?: FactLifecycle;
  initialDelay?: Duration | HumanDuration;
};

// @public (undocumented)
export interface FactRetrieverRegistry {
  // (undocumented)
  get(retrieverReference: string): Promise<FactRetrieverRegistration>;
  // (undocumented)
  getSchemas(): Promise<FactSchema[]>;
  // (undocumented)
  listRegistrations(): Promise<FactRetrieverRegistration[]>;
  // (undocumented)
  listRetrievers(): Promise<FactRetriever[]>;
  // (undocumented)
  register(registration: FactRetrieverRegistration): Promise<void>;
}

// @public
export type FactSchemaDefinition = Omit<FactRetriever, 'handler'>;

// @public
export type FlatTechInsightFact = TechInsightFact & {
  id: string;
};

// @public
export type MaxItems = {
  maxItems: number;
};

// @public
export type PersistenceContext = {
  techInsightsStore: TechInsightsStore;
};

// @public
export interface TechInsightCheck {
  description: string;
  factIds: string[];
  failureMetadata?: Record<string, any>;
  id: string;
  name: string;
  successMetadata?: Record<string, any>;
  type: string;
}

// @public
export interface TechInsightCheckRegistry<CheckType extends TechInsightCheck> {
  // (undocumented)
  get(checkId: string): Promise<CheckType>;
  // (undocumented)
  getAll(checks: string[]): Promise<CheckType[]>;
  // (undocumented)
  list(): Promise<CheckType[]>;
  // (undocumented)
  register(check: CheckType): Promise<CheckType>;
}

// @public
export type TechInsightFact = {
  entity: {
    namespace: string;
    kind: string;
    name: string;
  };
  facts: Record<
    string,
    | number
    | string
    | boolean
    | DateTime
    | number[]
    | string[]
    | boolean[]
    | DateTime[]
    | JsonValue
  >;
  timestamp?: DateTime;
};

// @public (undocumented)
export interface TechInsightsFactCheckerFactoryExtensionPoint {
  // (undocumented)
  setFactCheckerFactory<
    CheckType extends TechInsightCheck,
    CheckResultType extends CheckResult,
  >(
    factory: FactCheckerFactory<CheckType, CheckResultType>,
  ): void;
}

// @public
export const techInsightsFactCheckerFactoryExtensionPoint: ExtensionPoint<TechInsightsFactCheckerFactoryExtensionPoint>;

// @public (undocumented)
export interface TechInsightsFactRetrieverRegistryExtensionPoint {
  // (undocumented)
  setFactRetrieverRegistry(registry: FactRetrieverRegistry): void;
}

// @public
export const techInsightsFactRetrieverRegistryExtensionPoint: ExtensionPoint<TechInsightsFactRetrieverRegistryExtensionPoint>;

// @public (undocumented)
export interface TechInsightsFactRetrieversExtensionPoint {
  // (undocumented)
  addFactRetrievers(factRetrievers: Record<string, FactRetriever>): void;
}

// @public
export const techInsightsFactRetrieversExtensionPoint: ExtensionPoint<TechInsightsFactRetrieversExtensionPoint>;

// @public (undocumented)
export interface TechInsightsPersistenceContextExtensionPoint {
  // (undocumented)
  setPersistenceContext(context: PersistenceContext): void;
}

// @public
export const techInsightsPersistenceContextExtensionPoint: ExtensionPoint<TechInsightsPersistenceContextExtensionPoint>;

// @public
export interface TechInsightsStore {
  getFactsBetweenTimestampsByIds(
    ids: string[],
    entity: string,
    startDateTime: DateTime,
    endDateTime: DateTime,
  ): Promise<{
    [factRef: string]: FlatTechInsightFact[];
  }>;
  // (undocumented)
  getLatestFactsByIds(
    ids: string[],
    entity: string,
  ): Promise<{
    [factRef: string]: FlatTechInsightFact;
  }>;
  getLatestSchemas(ids?: string[]): Promise<FactSchema[]>;
  insertFacts(options: {
    id: string;
    facts: TechInsightFact[];
    lifecycle?: FactLifecycle;
  }): Promise<void>;
  insertFactSchema(schemaDefinition: FactSchemaDefinition): Promise<void>;
}

// @public
export type TTL = {
  timeToLive: DurationLike;
};

// (No @packageDocumentation comment for this package)
```
